﻿//7.Sorting an array means to arrange its elements in increasing order. Write a program to sort an array.
//Use the "selection sort" algorithm: Find the smallest element, move it at the first position,
//find the smallest from the rest, move it at the second position, etc.


using System;

class SortingAnArray
{
    static void Main()
    {
        int numebrN = int.Parse(Console.ReadLine());
        int[] arrayN = new int[numebrN];
        int minimal = int.MaxValue;
        int indexArray = 0;
        for (int i = 0; i < arrayN.Length; i++)
        {
            arrayN[i] = int.Parse(Console.ReadLine());
            if (arrayN[i] < minimal)
            {
                minimal = arrayN[i];
                indexArray = i;
            }
        }
        arrayN[indexArray] = arrayN[0];
        arrayN[0] = minimal;
        for (int i = 1; i < arrayN.Length - 1; i++)
        {
            minimal = int.MaxValue;
            for (int j = i; j < arrayN.Length; j++)
            {
                if (arrayN[j] < minimal)
                {
                    minimal = arrayN[j];
                    indexArray = j;
                }
            }
            arrayN[indexArray] = arrayN[i];
            arrayN[i] = minimal;
        }
        for (int i = 0; i < arrayN.Length; i++)
        {
            Console.WriteLine(arrayN[i]);
        }
    }
}
